<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="author" content="逯灿灿">
    <title>人物</title>
    <style>
    *{
        box-sizing: border-box;
    }
    body{
        margin: 0;
        padding: 0;
    }
    .whole{
        width: 400px;
        height: 500px;
        border: 1px solid black;
        margin: 100px auto;
    }
    .bigimg{
        float: left;
        width: 295px;
        height: 294px;
        padding: 5px;
        /* border: 2px solid blue; */
    } 
    .bigimg img{
        width: 290px;
        height: 290px;
    }
    .smallimg{
        margin: 0;
        padding: 0;
    }
    .smallimg li{
        float: left;
        margin: 0;
        padding: 5px;;
        list-style: none;
        width: 98px;
        height: 98px;
    }
    .smallimg li img:hover{
        border: 1px solid blue;
    }
    .smallimg li img{
        width: 90px;
        height: 90px;
    }
    </style>
</head>

<body>
    <div class="whole">
        <div class="bigimg">
            <img src="./img/1.jpg" alt="">
        </div> 
        <ul class="smallimg">
            <li><a href="#"><img src="./img/1.jpg" alt=""></a></li>
            <li><a href="#"><img src="./img/2.jpg" alt=""></a></li>
            <li><a href="#"><img src="./img/3.jpg" alt=""></a></li>
            <li><a href="#"><img src="./img/4.jpg" alt=""></a></li>
            <li><a href="#"><img src="./img/5.png" alt=""></a></li>
            <li><a href="#"><img src="./img/6.jpg" alt=""></a></li>
            <li><a href="#"><img src="./img/7.jpg" alt=""></a></li>
            <li><a href="#"><img src="./img/8.jpg" alt=""></a></li>
            <li><a href="#"><img src="./img/9.jpg" alt=""></a></li>
            <li><a href="#"><img src="./img/10.jpg" alt=""></a></li>
            <li><a href="#"><img src="./img/11.jpg" alt=""></a></li>
        </ul>
    </div>
</body>

</html>
<script>
    var bigimg = document.querySelector('.bigimg').querySelector('img');
    var imgs = document.querySelector('.smallimg').querySelectorAll('img');

    var index = 0;
    for(var i = 0;i<imgs.length;i++){
        imgs[i].index = i;
        imgs[i].onmouseover = function(){
            bigimg.src = imgs[this.index].src;
            
        }
    }
</script>